<?php

class BBcodetest extends CI_Controller{
	
	
	function __construct(){
		parent::__construct();
		
		$this->load->library('bbcode');
        
        $this->bbcode->SetSmileyDir( $this->config->item('bbcode_smiley_dir') );
        $this->bbcode->SetSmileyURL( $this->config->item('bbcode_smiley_url') );
        $this->bbcode->SetDetectURLs( $this->config->item('bbcode_url_detection') );
        $this->bbcode->SetAllowAmpersand(true);  
        $this->load->model('menu_model');
        $this->data['menuitems'] = $this->menu_model->menuitems;
		
	}
	function index(){
		//echo 'bbcode test';
		//echo '</br>';
	
		$text="[img]http://static.php.net/www.php.net/images/php.gif[/img] :D :( :) :O";

		//$BBHandler=bbcode_create($arrayBBCode);
		//echo $this->bb_parse($text);
		//echo $this->bbcode->Parse($text);
		
		$this->data['main_content'] =  'bbcode_test';
		$this->data['selected_item'] = $this->menu_model->getMenuItem('home');
		$this->load->view('includes/template', $this->data);

	}
	
	function submit(){
		echo $this->input->post('content');
	}
}